﻿namespace SubhadraSolutions.Sharp.Utils.TestApplication
{
    using System.Windows.Forms;
    using System.Windows.Threading;

    using SubhadraSolutions.Sharp.Utils.Threading;
    using SubhadraSolutions.Sharp.Utils.Windows;

    public class DispatcherDependentForm:Form, IDispatcherDependent
    {
        /// <summary>
        /// The dispatcher
        /// </summary>
        private readonly WindowsDispatcherAdapter dispatcher;

        /// <summary>
        /// Initializes a new instance of the <see cref="DispatcherDependentForm"/> class.
        /// </summary>
        public DispatcherDependentForm()
        {
            this.dispatcher = new WindowsDispatcherAdapter(Dispatcher.CurrentDispatcher);
        }


        /// <summary>
        /// Gets the dispatcher.
        /// </summary>
        /// <returns>
        /// The <see cref="IDispatcher" />.
        /// </returns>
        public IDispatcher GetDispatcher()
        {
            return this.dispatcher;
        }
    }
}
